package com.easytopit.demo.service.impl;

import java.sql.Timestamp;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.easytopit.demo.dao.MovieMapper;
import com.easytopit.demo.domain.Comment;
import com.easytopit.demo.domain.Movie;
import com.easytopit.demo.domain.Score;
import com.easytopit.demo.domain.enumDomain.Status;
import com.easytopit.demo.service.MovieService;

@Service
public class MovieServiceImpl implements MovieService{
	
	@Autowired
	private MovieMapper movieMapper;
	
	@Override
	public String checkName(String name) {
		return movieMapper.checkName(name);
	}

	@Override
	public void addMovie(String name, String cover, String profile,Status status,
			Timestamp onTime,String country, String director, String length) {
		Movie movie = new Movie();
		movie.setName(name);
		movie.setCover(cover);
		movie.setProfile(profile);
		movie.setStatus(status);
		movie.setOnTime(onTime);
		movie.setDirector(director);
		movie.setCountry(country);
		movie.setLength(length);
		movieMapper.addMovie(movie);
	}
	
	@Override
	public String checkVersion(String name) {
		return movieMapper.checkVersion(name);
	}
	
	@Override
	public void addVersion(String name, String version, double price) {
		movieMapper.addVersion(name, version, price);
	}

	@Override
	public String checkType(String name) {
		return movieMapper.checkType(name);
	}
	
	@Override
	public void addType(String name, String type) {
		movieMapper.addType(name, type);
	}

	@Override
	public String checkActor(String name) {
		return movieMapper.checkActor(name);
	}

	@Override
	public void addActor(String name, String actor) {
		movieMapper.addActor(name, actor);
	}

	@Override
	public void addPhoto(String name, String photo) {
		movieMapper.addPhoto(name, photo);
	}

	@Override
	public void addCinema(String city,String name) {
		movieMapper.addCinema(city,name);
	}

	@Override
	public void addHall(String cinemaName, String name) {
		movieMapper.addHall(cinemaName, name);
	}

	@Override
	public String checkCinema(String city, String name) {
		return movieMapper.checkCinema(city, name);
	}

	@Override
	public String checkHall(String cinemaName, String name) {
		return movieMapper.checkHall(cinemaName, name);
	}

	@Override
	public List<Movie> movieList() {
		return movieMapper.movieList();
	}

	@Override
	public List<String> queryMovieByStatus(String status) {
		return movieMapper.queryMovieByStatus(status);
	}

	@Override
	public List<Movie> queryMovieByName(String name) {
		return movieMapper.queryMovieByName(name);
	}

	@Override
	public List<String> queryMovieByType(String type) {
		return movieMapper.queryMovieByType(type);
	}

	@Override
	public List<String> queryMovieByActor(String actor) {
		return movieMapper.queryMovieByActor(actor);
	}

	@Override
	public List<String> queryMovieByDirector(String director) {
		return movieMapper.queryMovieByDirector(director);
	}

	@Override
	public List<String> queryMovieByCountry(String country) {
		return movieMapper.queryMovieByCountry(country);
	}

	@Override
	public List<String> queryTypeByName(String name) {
		return movieMapper.queryTypeByName(name);
	}

	@Override
	public List<String> queryActorByName(String name) {
		return movieMapper.queryActorByName(name);
	}

	@Override
	public List<String> queryPhotoByName(String name) {
		return movieMapper.queryPhotoByName(name);
	}

	@Override
	public List<Comment> queryCommentByUserName(String name) {
		return movieMapper.queryCommentByUserName(name);
	}

	@Override
	public List<Comment> queryCommentByName(String name) {
		return movieMapper.queryCommentByName(name);
	}

	@Override
	public List<Score> queryScoreByName(String name) {
		return movieMapper.queryScoreByName(name);
	}

	@Override
	public Double avg(String name) {
		return movieMapper.avg(name);
	}

	@Override
	public Double queryPriceByVersion(String movie, String version) {
		return movieMapper.queryPriceByVersion(movie, version);
	}
}